package model;

import java.io.Serializable;

/**
 * Representation of the individual tile that the player or monster could or
 * could not occupy
 * 
 * @author s3222417
 * 
 */
@SuppressWarnings("serial")
public class GameTile implements Serializable
{
	private boolean isTraversable, isOccupied, isOccupiedByMonster;

	private int xCoord, yCoord;

	public GameTile()
	{
		super();
		this.isTraversable = false;
		this.isOccupied = false;
		this.isOccupiedByMonster = false;
		this.xCoord = 0;
		this.yCoord = 0;
	}

	/**
	 * Constructor
	 * 
	 * @param isTraversable
	 *            Whether the tile can be traversed or is non-traversable, such
	 *            as a wall
	 * @param isOccupied
	 *            Whether the tile is occupied by a player or monster.
	 * @param xCoord
	 *            The x coordinate of the tile, the origin of the x coordinate
	 *            is the lower left hand corner of the board, not the center
	 *            like traditional graphs
	 * @param yCoord
	 *            The y coordinate of the tile, the origin of the y coordinate
	 *            is the lower left hand corner of the board, not the center
	 *            like traditional graphs
	 */

	public GameTile(boolean isTraversable, boolean isOccupied, int xCoord,
			int yCoord)
	{
		super();
		this.isTraversable = isTraversable;
		this.isOccupied = isOccupied;
		this.xCoord = xCoord;
		this.yCoord = yCoord;

	}

	public boolean compareLocation(GameTile gameTile)
	{
		if (this.xCoord != gameTile.getxCoord()
				|| this.yCoord != gameTile.getyCoord())
		{
			return false;
		}

		return true;
	}

	public boolean isTraversable()
	{
		return isTraversable;
	}

	public void setTraversable(boolean isTraversable)
	{
		this.isTraversable = isTraversable;
	}

	public boolean isOccupied()
	{
		return isOccupied;
	}

	public void setOccupied(boolean isOccupied)
	{
		this.isOccupied = isOccupied;
	}

	public int getxCoord()
	{
		return xCoord;
	}

	public void setxCoord(int xCoord)
	{
		this.xCoord = xCoord;
	}

	public int getyCoord()
	{
		return yCoord;
	}

	public void setyCoord(int yCoord)
	{
		this.yCoord = yCoord;
	}

	public boolean isOccupiedByMonster()
	{
		return isOccupiedByMonster;
	}

	public void setOccupiedByMonster(boolean isOccupiedByMonster)
	{
		this.isOccupiedByMonster = isOccupiedByMonster;
	}

}
